
ifeq ($(strip $(XGBA)),)
$(error "XGBA SRC PATH NO FIND!")
endif

SRC := $(XGBA)/src/vram.c \
	$(XGBA)/src/xgba.c \
	$(XGBA)/src/cpu/arm_decode2.c \
	$(XGBA)/src/cpu/thumb.c \
	$(XGBA)/src/cpu/thumb_fast.c \
	$(XGBA)/src/cpu/armx.c \
	main.c

OBJS := $(SRC:.c=.o)

CFLAGS := \
	-I$(XGBA)/include \
	-g

LDFLAGS := \
	-lsdl2

OUT := xgba.exe

$(OUT):$(OBJS)
	gcc $^ $(LDFLAGS) -o $@

%.o:%.c
	gcc -c $< $(CFLAGS) -o $@

clean:
	-rm $(OBJS)
